%matplotlib inline
import warnings
warnings.simplefilter('ignore')
Nilearn can do many things. We arbitrarily picked a few for this 5-minute demo. Check out the documentation (https://nilearn.github.io/user_guide.html) and the example gallery (https://nilearn.github.io/auto_examples/index.html) for more!
# Download and plot a group-level statistical map:
from nilearn import datasets
img = datasets.fetch_neurovault_motor_task()['images'][0]
print(img)
from nilearn import plotting
plotting.view_img(img, threshold='95%')
Made with the brainsprite viewer: https://github.com/SIMEXP/brainsprite.js
view = plotting.view_img(img, threshold='95%')
view.open_in_browser()
Static plots (matplotlib figures)
plotting.plot_stat_map(
img, threshold=3, display_mode='z', cut_coords=[-20,64])
Projections on the cortical surface
plotting.view_img_on_surf(img, threshold='95%')
plotting.view_img_on_surf(img, threshold='95%', surf_mesh='fsaverage')